{template header}

<!--{if $webglobal[mode]=='content'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal['file_news']['rootCategory']['name']}管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=contentadd&root={$webrequest['root']}">[添加普通文章]</a>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=imageadd&root={$webrequest['root']}">[添加图片集]</a>
			</td></tr>
		</tbody>
	</table>
	<form name="searchform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=content">
	<input type="hidden" name="root" value="{$webrequest['root']}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<td colspan="3">搜索{$webglobal['file_news']['rootCategory']['name']}</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th style="width: 100px;">搜索选项</th>
				<td>
					<select name="class">
						<option value="0">--- 选择分类 ---</option>
						<!--{loop $webglobal[file_news][class] $categoryID $option}-->
						<option value="{$categoryID}">{$option[showName]}</option>
						<!--{/loop}-->
					</select>
					<select name="arcrank">
						<option value="-2">--- 文档状态 ---</option>
						<option value="-1">待审核稿件</option>
						<option value="0">开放浏览</option>
						<option value="1">注册会员</option>
						<option value="2">认证会员</option>
					</select>
					<script type="text/javascript">
						common_CheckedSelect('class', '{$webrequest[class]}');
						common_CheckedSelect('arcrank', '{$webrequest[arcrank]}');
					</script>
					<input type="text" name="searchkey" value="$webrequest[searchkey]" size="50" />
				</td>
				<td style="width: 100px; text-align: center"><input type="submit" name="searchsubmit" value=" 搜  索 " /></td>
			</tr>
		</tbody>
	</table>
	</form>

	<form id="postform" name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=newsup&check&gourl={$webglobal[file_news][gourlencode]}">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<th width="5%"><a href="{ADMIN_WEBURLPATH}/index.php?mode=content&order=id{$webglobal[file_news][pageurl]}" class="special" title="点击按此排序">ID<!--{if $webrequest[order]=='id'}-->↓<!--{/if}--></a></th>
				<th width="4%">选择</th>
				<th>文章标题</th>
				<th width="10%">更新时间</th>
				<th width="10%">类目</th>
				<th width="5%">点击</th>
				<th width="8%">权限</th>
				<th width="8%">发布人</th>
				<th width="10%">操作</th>
			</tr>
		</thead>
		<tbody>
			<!--{if $webglobal[file_news][datanum]>0}-->
				<!--{loop $webglobal[file_news][dataarray] $tempkey $temptable}-->
					<tr>
						<td{$temptable[tdclass]}>$temptable[id]</td>
						<td{$temptable[tdclass]}><input type="checkbox" class="selectUnit" name="checkid[]" value="{$tempkey}" /></td>
						<td{$temptable[tdclass]}>$temptable[title]</td>
						<td{$temptable[tdclass]}>$temptable[edittime_show]</td>
						<td{$temptable[tdclass]}>{$webglobal[file_news][category][$temptable[news_category_id]][name]}</td>
						<td{$temptable[tdclass]}>{$temptable[click]}</td>
						<td{$temptable[tdclass]}>{$webglobal['file_news']['arcrank'][$temptable[arcrank]]}</td>
						<td{$temptable[tdclass]}>{$temptable[writer]}</td>
						<td{$temptable[tdclass]}>
							<a href="{ADMIN_WEBURLPATH}/index.php?mode={if $temptable['channel'] == 1}contentedit{else}imageedit{/if}&editid={$tempkey}&root={$webrequest['root']}&gourl={$webglobal[file_news][gourlencode]}" class="special">[编辑]</a>
							<a target="_block" href="{WEBURLPATH}/news.php?action=article&id={$temptable[id]}&preview" class="special">[预览]</a>
						</td>
					</tr>
				<!--{/loop}-->
			<!--{else}-->
				<tr><td colspan="10" style="text-align: center">还没有资讯。</td></tr>
			<!--{/if}-->
		</tbody>
	</table>

	<!--{if $webglobal[file_news][datanum]>0}-->
		<input type="hidden" name="access" id="access" value="delete">
		<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
			<tr>
				<td style="margin:0;padding:0;">
					<input type="button" name="checkall" id="checkall" onclick="javascript:selectall(true)" value=" 全选 " />
					<input type="button" name="checknotall" id="checknotall" onclick="javascript:selectall(false)" value=" 取消 " />
					<input type="button" name="deletesubmit" id="deletesubmit" onclick="checkdel()" value=" 删除 " />
				</td>
				<td style="text-align:right;margin:0;padding:5px 0;">{template page}</td>
			</tr>
		</table>
	<!--{/if}-->
	</form>
	<script type="text/javascript">
	function checkdel(){
		if(confirm('是否删除文章')){
			$('#postform').submit();
		}else{
			return false;
		}
	}
	function selectall(checkstatus) {
			$('.selectUnit').each(function(){
				$(this).attr('checked', checkstatus);
			});
		}
	$(document).ready(function(){
		$('#deletesubmit').click(function(){
			$('#access').val('delete');
		});

		$('#updatesubmit').click(function(){
			$('#access').val('update');
		});
	});
	</script>
<!--{elseif $webglobal[mode]=='contentedit'}-->
	<script type="text/javascript" src="{WEBURLPATH}/javascript/calendar/WdatePicker.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>文档管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=content&{$webglobal['file_news']['gourl']}">[返回列表]</a>
			</td></tr>
		</tbody>
	</table>
	<form name="form1" id="form1" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=contentedit&check" enctype="multipart/form-data">
	<input type="hidden" name="editid" value="{$webrequest['editid']}" />
	<input type="hidden" name="gourl" value="{$webglobal['file_news']['gourl']}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">修改文档</td></tr>
		</thead>
		<tbody>
			{if $webrequest['root'] == 5}
			<tr>
				<th>所属品牌<span class="need"> *</span></th>
				<td>
					<select name="brand_id">
					<option value="0">所属品牌...</option>
					{loop $webglobal['file_news']['brandinfo'] $brand}
					<option value="{$brand[id]}"{if $webglobal['file_news']['editinfo']['brand_id'] == $brand[id]} selected{/if}>{$brand[name]}</option>
					{/loop}
					</select>
				</td>
			</tr>
			{/if}
			<tr>
				<th>文章标题<span class="need"> *</span></th>
				<td>
					<input type="text" id="title" style="width:300px" name="title" value="{$webglobal['file_news']['editinfo']['title']}" />
					简略标题:
					<input type="text" style="width:150px" name="shorttitle" value="{$webglobal['file_news']['editinfo']['shorttitle']}" />
				</td>
			</tr>
			<tr>
				<th>自定义属性</th>
				<td>
					<input type='checkbox' name='flags[]' value='h'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'h')} checked{/if}>头条
					<input type='checkbox' name='flags[]' value='c'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'c')} checked{/if}>推荐
					<input type='checkbox' name='flags[]' value='f'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'f')} checked{/if}>幻灯
					<input type='checkbox' name='flags[]' value='p'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'p')} checked{/if}>图片
					<input type='checkbox' name='flags[]' value='a'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'a')} checked{/if}>特别推荐
				</td>
			</tr>
			<tr>
				<th>缩略图</th>
				<td>
					<input name="picname" type="text" id="picname" value="{$webglobal['file_news']['editinfo']['litpic']}" style="width:240px" />
					<input type="button"  value="本地上传" style="width:70px;cursor:pointer;" />
					<iframe name='uplitpicfra' id='uplitpicfra' src='' style='display:none'></iframe>
					<span class="litpic_span">
					<input name="litpic" type="file" id="litpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, '{ADMIN_WEBURLPATH}/index.php?mode=contentedit&check');" size="1" class='np coolbg'/>
					</span>
					<!-- <input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('picname');" class='np coolbg'/> -->
					<div id='divpicview' class='divpre'></div>
				</td>
			</tr>
			<tr>
				<th>文章来源</th>
				<td>
					<input type="text" name="from" size="50" value="{$webglobal['file_news']['editinfo']['from']}" />
					作者:
					<input type="text" name="writer" size="50" value="{$webglobal['file_news']['editinfo']['writer']}" />
				</td>
			</tr>
			<tr>
				<th>文章主栏目<span class="need"> *</span></th>
				<td>
					<select name="news_category_id">
						<option value="0">请选择栏目...</option>
						<!--{loop $webglobal[file_news][class] $categoryID $option}-->
						<option value="{$categoryID}" class="{$option['class']}"{if $webglobal['file_news']['editinfo']['news_category_id'] == $categoryID} selected{/if}>{$option[showName]}</option>
						<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>关键字</th>
				<td><input type="text" name="keywords" size="50" value="{$webglobal['file_news']['editinfo']['keywords']}" /></td>
			</tr>
			<tr>
				<th>内容摘要</th>
				<td>
					<textarea style="width:449px;height:50px" id="description" rows="5" name="description">{$webglobal['file_news']['editinfo']['description']}</textarea>
				</td>
			</tr>
			<tr>
				<th>文章内容<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'content',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=news',
							resizeMode : 1
						});
					</script>
					<textarea id="content" name="content" style="width:100%;height:500px;">{$webglobal['file_news']['editinfo']['content']}</textarea>
				</td>
			</tr>
		</tbody>
	</table>
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">高级参数</td></tr>
		</thead>
		<tbody>
			<tr>
				<td width="90px">浏览次数</td>
				<td width="150px">
					<input type="text" style="width:100px;" value="{$webglobal['file_news']['editinfo']['click']}" name="click">
				</td>
				<td width="90px">标题颜色</td>
				<td>
					<input name="color" type="text" value="{$webglobal['file_news']['editinfo']['color']}" id="color" style="width:120px">
					<input name="modcolor" type="button" id="modcolor" value="选取" onClick="ShowColor(event,this)">
				</td>
			</tr>
			<tr>
				<td>阅读权限</td>
				<td>
					<select name="arcrank">
					<!--{loop $webglobal['file_news']['arcrank'] $rankkey $rankvalue}-->
					<option value="{$rankkey}"{if $webglobal['file_news']['editinfo']['arcrank'] == $rankkey} selected{/if}>{$rankvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
				<td>发布时间</td>
				<td>
					<input type="text" class="Wdate" name="showtime" style="width:138px" value="{$webglobal['file_news']['editinfo']['showtime_show']}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
				</td>
			</tr>
			<tr>
				<td>文章排序</td>
				<td colspan="3">
					<select name="sortup" id="sortup" style="width:150">
						<option value="0"{if $webglobal['file_news']['editinfo']['sortup'] == 0} selected{/if}>默认排序</option>
						<option value="7"{if $webglobal['file_news']['editinfo']['sortup'] == 7} selected{/if}>置顶一周</option>
						<option value="30"{if $webglobal['file_news']['editinfo']['sortup'] == 30} selected{/if}>置顶一个月</option>
						<option value="90"{if $webglobal['file_news']['editinfo']['sortup'] == 90} selected{/if}>置顶三个月</option>
						<option value="180"{if $webglobal['file_news']['editinfo']['sortup'] == 180} selected{/if}>置顶半年</option>
						<option value="360"{if $webglobal['file_news']['editinfo']['sortup'] == 360} selected{/if}>置顶一年</option>
					</select>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="4">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='contentadd'}-->
	<script type="text/javascript" src="{WEBURLPATH}/javascript/calendar/WdatePicker.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal['file_news']['rootCategory']['name']}管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=content&root={$webrequest['root']}">[{$webglobal['file_news']['rootCategory']['name']}列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="form1" id="form1" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=contentadd&check" enctype="multipart/form-data">
	<input type="hidden" name="root" value="{$webrequest['root']}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加{$webglobal['file_news']['rootCategory']['name']}</td></tr>
		</thead>
		<tbody>
			{if $webrequest['root'] == 5}
			<tr>
				<th>所属品牌<span class="need"> *</span></th>
				<td>
					<select name="brand_id">
					<option value="0">所属品牌...</option>
					{loop $webglobal['file_news']['brandinfo'] $brand}
					<option value="{$brand[id]}">{$brand[name]}</option>
					{/loop}
					</select>
				</td>
			</tr>
			{/if}
			<tr>
				<th>文章标题<span class="need"> *</span></th>
				<td>
					<input type="text" id="title" style="width:300px" name="title" value="" />
					简略标题:
					<input type="text" style="width:150px" name="shorttitle" value="" />
				</td>
			</tr>
			<tr>
				<th>自定义属性</th>
				<td>
					<input type='checkbox' name='flags[]' value='h'>头条
					<input type='checkbox' name='flags[]' value='c'>推荐
					<input type='checkbox' name='flags[]' value='f'>幻灯
					<input type='checkbox' name='flags[]' value='p'>图片
					<input type='checkbox' name='flags[]' value='a'>特别推荐
				</td>
			</tr>
			<tr>
				<th>缩略图</th>
				<td>
					<input name="picname" type="text" id="picname" style="width:240px" />
					<input type="button"  value="本地上传" style="width:70px;cursor:pointer;" />
					<iframe name='uplitpicfra' id='uplitpicfra' src='' style='display:none'></iframe>
					<span class="litpic_span">
					<input name="litpic" type="file" id="litpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, '{ADMIN_WEBURLPATH}/index.php?mode=contentadd&check');" size="1" class='np coolbg'/>
					</span>
					<!-- <input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('picname');" class='np coolbg'/> -->
					<div id='divpicview' class='divpre'></div>
				</td>
			</tr>
			<tr>
				<th>文章来源</th>
				<td>
					<input type="text" name="from" size="50" value="" />
					作者:
					<input type="text" name="writer" size="50" value="" />
				</td>
			</tr>
			<tr>
				<th>文章主栏目<span class="need"> *</span></th>
				<td>
					<select name="news_category_id">
						<option value="0">请选择栏目...</option>
						<!--{loop $webglobal[file_news][class] $categoryID $option}-->
						<option value="{$categoryID}" class="{$option['class']}">{$option[showName]}</option>
						<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>关键字</th>
				<td><input type="text" name="keywords" size="50" value="" /></td>
			</tr>
			<tr>
				<th>内容摘要</th>
				<td>
					<textarea style="width:449px;height:50px" id="description" rows="5" name="description"></textarea>
				</td>
			</tr>
			<tr>
				<th>文章内容<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'content',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=news',
							resizeMode : 1
						});
					</script>
					<textarea id="content" name="content" style="width:100%;height:500px;"></textarea>
				</td>
			</tr>
		</tbody>
	</table>
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">高级参数</td></tr>
		</thead>
		<tbody>
			<tr>
				<td width="90px">浏览次数</td>
				<td width="150px">
					<input type="text" style="width:100px;" value="94" name="click">
				</td>
				<td width="90px">标题颜色</td>
				<td>
					<input name="color" type="text" id="color" style="width:120px">
					<input name="modcolor" type="button" id="modcolor" value="选取" onClick="ShowColor(event,this)">
				</td>
			</tr>
			<tr>
				<td>阅读权限</td>
				<td>
					<select name="arcrank">
					<!--{loop $webglobal['file_news']['arcrank'] $rankkey $rankvalue}-->
					<option value="{$rankkey}">{$rankvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
				<td>发布时间</td>
				<td>
					<input type="text" class="Wdate" name="showtime" style="width:138px" value="{$webglobal['file_news']['nowtime']}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
				</td>
			</tr>
			<tr>
				<td>文章排序</td>
				<td colspan="3">
					<select name="sortup" id="sortup" style="width:150">
						<option value="0" selected>默认排序</option>
						<option value="7">置顶一周</option>
						<option value="30">置顶一个月</option>
						<option value="90">置顶三个月</option>
						<option value="180">置顶半年</option>
						<option value="360">置顶一年</option>
					</select>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="4">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{/if}-->

{template footer}